package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ShopFriendlyLinksMapper;
import com.ruoyi.system.domain.ShopFriendlyLinks;
import com.ruoyi.system.service.IShopFriendlyLinksService;

/**
 * 友情连接Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-06-03
 */
@Service
public class ShopFriendlyLinksServiceImpl implements IShopFriendlyLinksService 
{
    @Autowired
    private ShopFriendlyLinksMapper shopFriendlyLinksMapper;

    /**
     * 查询友情连接
     * 
     * @param linkId 友情连接主键
     * @return 友情连接
     */
    @Override
    public ShopFriendlyLinks selectShopFriendlyLinksByLinkId(Long linkId)
    {
        return shopFriendlyLinksMapper.selectShopFriendlyLinksByLinkId(linkId);
    }

    /**
     * 查询友情连接列表
     * 
     * @param shopFriendlyLinks 友情连接
     * @return 友情连接
     */
    @Override
    public List<ShopFriendlyLinks> selectShopFriendlyLinksList(ShopFriendlyLinks shopFriendlyLinks)
    {
        return shopFriendlyLinksMapper.selectShopFriendlyLinksList(shopFriendlyLinks);
    }

    /**
     * 新增友情连接
     * 
     * @param shopFriendlyLinks 友情连接
     * @return 结果
     */
    @Override
    public int insertShopFriendlyLinks(ShopFriendlyLinks shopFriendlyLinks)
    {
        shopFriendlyLinks.setCreateTime(DateUtils.getNowDate());
        return shopFriendlyLinksMapper.insertShopFriendlyLinks(shopFriendlyLinks);
    }

    /**
     * 修改友情连接
     * 
     * @param shopFriendlyLinks 友情连接
     * @return 结果
     */
    @Override
    public int updateShopFriendlyLinks(ShopFriendlyLinks shopFriendlyLinks)
    {
        shopFriendlyLinks.setUpdateTime(DateUtils.getNowDate());
        return shopFriendlyLinksMapper.updateShopFriendlyLinks(shopFriendlyLinks);
    }

    /**
     * 批量删除友情连接
     * 
     * @param linkIds 需要删除的友情连接主键
     * @return 结果
     */
    @Override
    public int deleteShopFriendlyLinksByLinkIds(Long[] linkIds)
    {
        return shopFriendlyLinksMapper.deleteShopFriendlyLinksByLinkIds(linkIds);
    }

    /**
     * 删除友情连接信息
     * 
     * @param linkId 友情连接主键
     * @return 结果
     */
    @Override
    public int deleteShopFriendlyLinksByLinkId(Long linkId)
    {
        return shopFriendlyLinksMapper.deleteShopFriendlyLinksByLinkId(linkId);
    }
}
